import { getUserInfo } from "../tools/cookieMgr";
import request from "../tools/request"
const addShoppingCar=(productId)=>{
    var data={
        accountId:getUserInfo().id,
        productId:productId,
        count:1
    }
    return request.post("/ShoppingCars/Add",data);
}

const getShoppingCarPagination=(data)=> {
    return request.get("/ShoppingCars/Pagination",data);
}

const deleteShoppingCar=(id)=>{
    return request.post("/ShoppingCars/Delete",{id});
}

const reduceCount=(id)=>{
    return request.post("/ShoppingCars/Reduce",{id});
}

const riseCount=(id)=>{
    return request.post("/ShoppingCars/Rise",{id});
}

export {
    addShoppingCar,getShoppingCarPagination,deleteShoppingCar,reduceCount,riseCount
}
